home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / include / asm / ptrace.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-09-09  |  1.7 KB  |  103 lines

  1. #ifndef _ASM_X86_PTRACE_H
  2. #define _ASM_X86_PTRACE_H
  3.  
  4.     /* For */
  5. #include <asm/ptrace-abi.h>
  6. #include <asm/processor-flags.h>
  7.  
  8.  
  9. #ifndef __ASSEMBLY__
  10.  
  11. #ifdef __i386__
  12. /* this struct defines the way the registers are stored on the
  13.    stack during a system call. */
  14.  
  15.  
  16. struct pt_regs {
  17.     long ebx;
  18.     long ecx;
  19.     long edx;
  20.     long esi;
  21.     long edi;
  22.     long ebp;
  23.     long eax;
  24.     int  xds;
  25.     int  xes;
  26.     int  xfs;
  27.     /* int  gs; */
  28.     long orig_eax;
  29.     long eip;
  30.     int  xcs;
  31.     long eflags;
  32.     long esp;
  33.     int  xss;
  34. };
  35.  
  36.  
  37. #else /* __i386__ */
  38.  
  39.  
  40. struct pt_regs {
  41.     unsigned long r15;
  42.     unsigned long r14;
  43.     unsigned long r13;
  44.     unsigned long r12;
  45.     unsigned long rbp;
  46.     unsigned long rbx;
  47. /* arguments: non interrupts/non tracing syscalls only save upto here*/
  48.     unsigned long r11;
  49.     unsigned long r10;
  50.     unsigned long r9;
  51.     unsigned long r8;
  52.     unsigned long rax;
  53.     unsigned long rcx;
  54.     unsigned long rdx;
  55.     unsigned long rsi;
  56.     unsigned long rdi;
  57.     unsigned long orig_rax;
  58. /* end of arguments */
  59. /* cpu exception frame or undefined */
  60.     unsigned long rip;
  61.     unsigned long cs;
  62.     unsigned long eflags;
  63.     unsigned long rsp;
  64.     unsigned long ss;
  65. /* top of stack page */
  66. };
  67.  
  68. #endif /* !__i386__ */
  69.  
  70.  
  71. #ifdef CONFIG_X86_PTRACE_BTS
  72. /* a branch trace record entry
  73.  *
  74.  * In order to unify the interface between various processor versions,
  75.  * we use the below data structure for all processors.
  76.  */
  77. enum bts_qualifier {
  78.     BTS_INVALID = 0,
  79.     BTS_BRANCH,
  80.     BTS_TASK_ARRIVES,
  81.     BTS_TASK_DEPARTS
  82. };
  83.  
  84. struct bts_struct {
  85.     __u64 qualifier;
  86.     union {
  87.         /* BTS_BRANCH */
  88.         struct {
  89.             __u64 from_ip;
  90.             __u64 to_ip;
  91.         } lbr;
  92.         /* BTS_TASK_ARRIVES or
  93.            BTS_TASK_DEPARTS */
  94.         __u64 jiffies;
  95.     } variant;
  96. };
  97. #endif /* CONFIG_X86_PTRACE_BTS */
  98.  
  99.  
  100. #endif /* !__ASSEMBLY__ */
  101.  
  102. #endif /* _ASM_X86_PTRACE_H */
  103.